package com.ae.shield.common.net;

import com.ae.shield.ModLib;
import com.ae.shield.common.net.toSever.ScreenButtonPressed;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.network.NetworkRegistry;
import net.minecraftforge.fml.network.simple.SimpleChannel;

public class ModNetwork {
    public static final String NETWORK_VER = "1";
    public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel(new ResourceLocation(ModLib.MOD_ID, "channel_1"), () -> NETWORK_VER, version -> version.equals(NETWORK_VER), version -> version.equals(NETWORK_VER));

    public static void register() {
        int id = 0;
        CHANNEL.registerMessage(id++, ScreenButtonPressed.class, ScreenButtonPressed::encode, ScreenButtonPressed::decode, ScreenButtonPressed::handle);
    }
}
